﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;
using RuleCode.Table;
namespace map.member.order
{
    public partial class sell_5 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                bind1();
            }
        }
        private void bind1()
        {
            taobaotrade t = taobaotrade.Find(" seller_nick = '"
                + AliApi.appUserId
                + "' and ((taobaostatus = '" + TRADE_STATUS.Buyer_Order + "' and cbtrantype = '" + TRADE_TranType.PostBySelf + "')"
                + " or (taobaostatus = '"+TRADE_STATUS .Buyer_Pay +"'))"
                );
            WebPager1.DataSource = t.MyTable;
            WebPager1.DataBind();
        }

        protected void WebPager1_PageIndexChanged(object sender, RuleCode.Controls.PageChangedEventArgs e)
        {
            WebPager1.CurrentPageIndex = e.NewPageIndex;
            bind1();
        }
        protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            string id = e.CommandArgument.ToString();
            if (e.CommandName == "post")
            {
                taobaotrade ui = taobaotrade.Find(" recid = " + id);
                ui.taobaostatus.Value = TRADE_STATUS.Seller_Post ;
                ui.Modify();

                MessageBox.Show(this.UpdatePanel1, "操作成功,订单已经改为发货状态." );
                bind1();
            }
        }
    }
}
